package com.synjones.zeuscloudserver.controller;

import com.synjones.zeus.model.ExReqBean;
import com.synjones.zeus.model.ExRespBean;
import com.synjones.zeus.model.authorize.AuthorizeReqBean;
import com.synjones.zeuscloudserver.service.AuthorizeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.synjones.zeus.model.ApiStr.AUTHORIZEDEVICE;

/**
 * 设备授权
 * @author Think
 * Description: 设备授权
 * @date created in 11:37 2018-05-22
 * Modified by:
 */
@RestController
public class AuthorizeController {

    private static final Logger LOG = LoggerFactory.getLogger(AuthorizeController.class);

    @Autowired
    @Qualifier("authorizeServiceImpl")
    private AuthorizeService authorizeService;

    /**
     *  设备授权
     *  @param reqBean
     *  @author Think
     *  Description: 设备授权
     *  @date 11:37 2018-05-22
     *  @return ExRespBean<List<MealResBean>>
     *  throws
     */
    @RequestMapping(value = AUTHORIZEDEVICE)
    public ExRespBean<String> authorizeDevice(@RequestBody ExReqBean<AuthorizeReqBean> reqBean) {
        return authorizeService.authorizeDevice(reqBean);
    }

}
